#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
long long int n, digit, outcome = 0;
long long int people[100000] = { 0 };
void Bubble_sort(long long int digit,long long int* digits)
{
	long long int a = 0, b = 1, i;
	for (i = 0; i < digit - 2; i++) {
		a = 0;
		b = 1;
		for (int j = 0; j < digit - 1 - i; j++) {
			if (digits[a] < digits[b]) outcome += digits[b];
			else outcome += digits[a];
			a++;
			b++;
		}
	}
}
int main()
{
	scanf("%lld", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &digit);
		people[i] = digit;
		if (i >= 1 && i < n) {
			if (people[i-1] < people[i]) outcome += people[i];
			else outcome += people[i-1];
		}
	}
	//Bubble_sort(n, people);
	printf("%lld", outcome);
	return 0;
}